#! /usr/bin/env python
# encoding=utf-8

from xml.sax import parseString
from xml.sax.handler import ContentHandler
from urllib import urlopen
 
class Handler(ContentHandler):
	def startElement(self, name, attrs):
		if name == 'post':
			print attrs.getValue(u'time'), '->', attrs.getValue(u'href')

url = 'https://xxxx:xxxx@api.del.icio.us/v1/posts/recent'
content = urlopen(url).read()
print 'Últimas URL enviadas a delicious:\n'
parser = parseString(content, Handler())
